package map;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;

public class Simple {
	public static void main(String[] args) {
	    ArrayList al = new ArrayList();
		al.add(new ComparableDemo(03, "vibhanshu", 24));
		al.add(new ComparableDemo(13, "rajeev", 25));
		al.add(new ComparableDemo(16, "shivanshu", 14));
		al.add(new ComparableDemo(25, "shivanshu", 14));
		Collections.sort(al);
		Iterator itr = al.iterator();
		while (itr.hasNext()){
		ComparableDemo cd = (ComparableDemo)itr.next();
		System.out.println(cd.age+" "+cd.name+" "+cd.rollno);
		}
	}

}
